<template>
  <div>
    <div class="head">
      <a-input v-model:value="search" placeholder="请输入" class="head-search"></a-input>
      <a-button @click="searchData" type="primary">搜索</a-button>
    </div>
    <div>
      <a-table :columns="columns" :data-source="data">
        <template #headerCell="{ column }">
          <template v-if="column.key === 'name'">
            <span>
              Name
            </span>
          </template>
        </template>
      </a-table>
    </div>
  </div>
</template>

<script setup>
import { onBeforeMount, onMounted, ref } from 'vue'
const search = ref('')
const page = ref({
  pageNo: 1,
  pageSize: 10,
  total: 0
})
const columns = [
  {
    name: '用户',
    dataIndex: 'name',
    key: 'name',
  },
  {
    title: '总时长',
    dataIndex: 'age',
    key: 'age',
  },
  {
    title: '目标设定',
    dataIndex: 'address',
    key: 'address',
  },
  {
    title: '任务拆分',
    key: 'tags',
    dataIndex: 'tags',
  },
  {
    title: '任务追踪',
    dataIndex: 'type',
    key: 'type',
  },
  {
    title: '情绪报告',
    key: 'type1',
    dataIndex: 'type1'
  },
  {
    title: '精灵空间',
    key: 'type2',
    dataIndex: 'type2'
  },
];
const data = [
  {
    key: '1',
    name: 'John Brown',
    age: 32,
    address: 'New York No. 1 Lake Park',
    tags: ['nice', 'developer'],
    type: '111',
    type1: '222',
    type2: '333'
  },
  {
    key: '2',
    name: 'Jim Green',
    age: 42,
    address: 'London No. 1 Lake Park',
    tags: ['loser'],
    type: '111',
    type1: '222',
    type2: '333'
  },
  {
    key: '3',
    name: 'Joe Black',
    age: 32,
    address: 'Sidney No. 1 Lake Park',
    tags: ['cool', 'teacher'],
    type: '111',
    type1: '222',
    type2: '333'
  },
];

const searchData = () => {

}
onMounted(() => {
})
</script>
<style scoped lang='scss'>
.head {
  display: flex;
  .head-search {
    width: 200px;
    margin-right: 16px;
    margin-bottom: 24px;
  }
}
</style>